﻿using System;
using Microsoft.Phone.Tasks;
using WindowsPhoneEssentials.Tasks;

namespace WindowsPhoneMvp.Mocks.Phone
{
    public class MockTaskManager : ITaskManager
    {
        /// <summary>
        /// Specifies the return task arguments given the Type of the chooser
        /// </summary>
        public Func<Type,TaskEventArgs> Returns { get; set; }

        public void StartTask<TChooser, TTaskEventArgs>(Action<TTaskEventArgs> onComplete)
            where TChooser : ChooserBase<TTaskEventArgs>, new() 
            where TTaskEventArgs : TaskEventArgs
        {
            onComplete((TTaskEventArgs)Returns(typeof(TChooser)));
        }

        public void ComposeEmail(string to = null, string cc = null, string bcc = null, string subject = null, string body = null, int? codePage = new int?())
        {
            
        }

        public void ShowWebsite(string uri, bool launchInBrowser)
        {
            
        }
    }
}
